//
//  LPTComPositionEditCompTableViewCell.m
//  LPTClient
//
//  Created by mac on 2018/12/9.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTComPositionEditCompTableViewCell.h"

@interface LPTComPositionEditCompTableViewCell ()<UITextViewDelegate>

@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (assign, nonatomic)CGFloat textViewContentHeight;

@end

@implementation LPTComPositionEditCompTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.textView.delegate = self;
}

-(NSString *)getTextContent
{
    return self.textView.text;
}

-(void)refreshWithContent:(NSString *)content
{
    self.textView.text = content;
}

#pragma mark - UITextViewDelegate
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    NSString *string = [textView.text stringByReplacingCharactersInRange:range withString:text];
    if (string.length > 50) {
        return NO;
    }
    
    return YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
